char* convertToBase7(int num)
{
    if (num == 0)
    {
        return "0";
    }
    char* arr = (char*)malloc(sizeof(char) * 32);
    int i = 0;
    int tmp = 0;
    while (num != 0)
    {
        if (num < 0)
        {
            tmp = num;
            num = -num;
        }
        arr[i++] = num % 7 + '0';
        num = num / 7;
    }
    if (tmp < 0)
    {
        arr[i++] = '-';
    }
    for (int l = 0, r = i - 1; l < r; l++, r--)
    {
        char c = arr[l];
        arr[l] = arr[r];
        arr[r] = c;
    }
    arr[i] = '\0';
    return arr;
}